import React from 'react'
import { message } from 'antd'
import { request } from '../request'

export interface orderResponse {
  code: number
  results: reslut
}

export interface reslut {
  records: OrderType[]
  total: number
  size: number
  current: number
  orders: any[]
  optimizeCountSql: boolean
  hitCount: boolean
  countId: number
  maxLimit: number
  searchCount: boolean
  pages: number
}

export interface OrderType {
  pPrice: number
  discount: number
  aPrice: number
  remark: string
  sPrice: number
  afterSales: string
  content: string
  duration: number
  startTime: string
  id: number
  endTime: string
  addr: string
  isDel: number
  code: string
  status: number
  userId: number
  userName: string
  userRemark: string
}

// const GetOrders = async (url: string): Promise<orderResponse> => {
//   let res
//   await request
//     .get({
//       url: url,
//     })
//     .then((data) => {
//       console.log(data)
//       res = data
//     })
//     .catch((e) => {
//       message.error(e)
//       res = { code: 403, results: null }
//     })
//   return res
// }

// export { GetOrders }
